package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjBjDlMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjBjDlEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjBjEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjBjDlService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjBjDlService")
public class JcAjztTjBjDlServiceImpl extends ServiceImpl<JcAjztTjBjDlMapper, JcAjztTjBjDlEntity> implements JcAjztTjBjDlService {

	@Override
	@DS("oracle")
	public IPage<JcAjztTjBjDlEntity> infoPage(JcAjztTjBjEntity jcAjztTjBjEntity) {
		Page page = new Page(jcAjztTjBjEntity.getPage(), jcAjztTjBjEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjBjDlEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjBjEntity.getJcry())){
			queryWrapper.like(JcAjztTjBjDlEntity::getJcry, jcAjztTjBjEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjBjEntity.getNd())){
			queryWrapper.eq(JcAjztTjBjDlEntity::getNd, jcAjztTjBjEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjBjEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjBjDlEntity::getSwjgDm, jcAjztTjBjEntity.getSwjgDm());
		}
		
		IPage<JcAjztTjBjDlEntity> iPage = this.page(page, queryWrapper);
		
		return iPage;
	}
}